/**
    @file   Segmentor.h
    @date   2010/11/29
    @author sang-soo kim
    @brief  Segmentor class
*/
#if !defined(__SEGMENTOR_H__)
#define __SEGMENTOR_H__
#pragma once
#include <string>
#include "Word.h"
#include "Character.h"
#include <vector>
#include "StringTokenizer.h"
#include <stdint.h>
#include <stdio.h>
#include <iostream>
#include "KRWS.h"
#include <dastrie.h>
#include "Node.h"

#define _NON    0
#define _KOR    1
#define _ALP    2
#define _NUM    3
#define _SYM    4
#define _EXT    9
#define _WEGIHT_TOKENS_         150
#define _WEGIHT_MAX_TOKENS_     999
#define _DEBUG_MODE_            

class Segmentor
{
    dastrie::trie<uint16_t> * m_pWordDict;
    dastrie::trie<std::string> * m_pCorrectDict;

    std::vector< Character > m_VChar;
    std::vector< Word > m_VWords;
    int getCharType( uint32_t  );
    void fetchWords(int, int,  int );
    void analyze( int, int );
public:
    void setLine(const std::string&);
    void setWordDict( std::string );
    void setCorrectDict( std::string );
    void setWordDict( dastrie::trie<uint16_t> * );
    void setCorrectDict( dastrie::trie<std::string> * );
    Segmentor();
    virtual ~Segmentor();
    int changingWords( std::string , int , int );
    void segmenting( std::string & ,std::vector<Word>& );
    void segmenting( std::vector<Word>&  );
    void setValue( Word & , int , int);
    void clear();
protected:    
    void checkException( void );

};

#endif


